package com.atguigu.day20.homework.h3;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/11/25 20:37
 * @注释
 */
public class Husband extends Thread{
    Account account;

    public Husband(String name, Account account) {
        super(name);
        this.account = account;
    }

    @Override
    public void run() {
        while(true){
            account.save(Math.random()*10000);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
